home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_casm
/
jlvesa11.zip
/
JLVESA23.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-11-14
|
2KB
|
88 lines
; This routine is part of the VESA SVGA -library
;
; Copyright 1994 Johannes Lehtinen
; All rights reserved
model large,c
p386
include "jlvesads.asm"
extrn vesa_repos_r:far
segment jlvesa23_TEXT USE16 'CODE'
assume cs:jlvesa23_TEXT
; JVUByte JVPixel_Read(JVSWord x, JVSWord y)
proc JVPixel_Read far
public JVPixel_Read
push bp
mov bp,sp
push ds
push es
push di
mov ax,JLVesa_Data
mov ds,ax
; Check that pixel is on the screen
mov ax,[ss:bp+6] ; Check x-coordinate
cmp ax,0
jl short outside
cmp [ds:Width],ax
jle short outside
mov ax,[ss:bp+8] ; Check y-coordinate
cmp ax,0
jl short outside
cmp [ds:Height],ax
jle short outside
; Calculate the absolute address of pixel
xor eax,eax ; Calculate the address of line
mov ax,[ss:bp+8]
xor ebx,ebx
mov bx,[ds:LWidth]
mul ebx
mov bx,[ss:bp+6] ; Calculate the address of pixel
add eax,ebx
add eax,[ds:AStart] ; Add start address of active page
mov edx,eax
; Check if window has to be repositioned
cmp [ds:RAStart],edx
jbe short check2
call far vesa_repos_r
check2:
mov ecx,edx
sub ecx,[ds:RAStart]
cmp [ds:WSize],ecx
ja short draw_pixel
call far vesa_repos_r
; Draw pixel to screen
draw_pixel:
sub edx,[ds:RAStart]
mov di,dx
mov ax,[ds:WWSeg]
mov es,ax
mov al,[es:di]
outside:
pop di
pop es
pop ds
pop bp
retf
endp
ends
end